<%= render :partial => "layouts/table_head", :locals => {:title => "Listando escenarios"} %>

<table cellspacing="0" cellpadding="3" style="margin: 5px;">
	<tr>
      <% for column in Escenario.content_columns %>
         <th>
          <% if column.human_name == "Ubicacion" %>
            Ubicaci&#243;n
          <% else %>
            <%= column.human_name %>            
          <% end %>
        </th>
      <% end %>
	</tr>
	<% count_row = 0 %>

	<% for escenario in @escenarios
		css_class = "fila_clara"
		
		if count_row % 2 > 0
			css_class = "fila_clara"
		else
			css_class = ""
		end
	%>
	<tr class="<%= css_class %>">
                <% for column in Escenario.content_columns %>
                        <td><%=h escenario.send(column.name) %></td>
                <% end %>
		<td><%= link_to_remote image_tag("b_insrow.png" ,  :class => "imagen", :title => "ver"),
				:url => { :action => 'show', :id => escenario},
				:update => 'main'
			%>
		</td>
		<td>
			<%= link_to_remote image_tag("edit.png" , :class => "imagen", :title => "editar"),
				:url => { :action => 'edit', :id =>  escenario },
				:update => 'main'
			%>
		</td>
		<td>
			<%= link_to_remote image_tag("remove.png" ,  :class => "imagen", :title => "eliminar"),
					:url => { :action => 'destroy', :id => escenario },
					:confirm => 'Esta seguro?',
					:method => :post, 
					:update => 'main' 
			%>
		</td>
	</tr>
	<% count_row = count_row + 1 %>
	<% end %>
</table>

	<%= link_to_remote 'anterior', :url => { :page => @escenario_pages.current.previous }, :update => 'main' if @escenario_pages.current.previous %>
        <%= link_to_remote 'siguiente', :url => { :page => @escenario_pages.current.next }, :update => 'main' if @escenario_pages.current.next %>
        <br />
        <%= link_to_remote 'A&#241;adir escenario', :url => { :action => 'new'}, :update => 'main' %> | <%= link_to_remote 'Atras', :url => 'jdnbb/home', :update => 'main' %>

<%= render :partial => "layouts/table_foot" %>
